package com.study.mirrorforest.main.common.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
/**
* 密码加密工具类
* 提供密码加密和匹配方法
* @author by liuhanzhi
*/
public class PasswordEncoderUtil {
    private static final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
    public static String encodePassword(String password) {
        return passwordEncoder.encode(password);
    }
    public static boolean matchesPassword(String rawPassword, String encodedPassword) {
        return passwordEncoder.matches(rawPassword, encodedPassword);
    }
}